package com.example.springbootbabyu.entity;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 功能
 * 作者：梦天
 * 日期：2025/5/15 11:14
 */
@Data
public class SubCategoryQueryDTO {
    @NotNull(message = "分类ID不能为空")
    private String categoryId;

    @Min(value = 1, message = "页码最小为1")
    private Integer page = 1;

    @Min(value = 1, message = "每页数量最小为1")
    @Max(value = 100, message = "每页数量最大为100")
    private Integer pageSize = 20;

    @Pattern(regexp = "publishTime|orderNum|evaluateNum",
            message = "排序字段不合法")
    private String sortField = "publishTime";
}